package com.fenghongzhang.day003mvp.view;

import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.Toast;

//import com.fenghongzhang.day003mvp.DaggerActivityComponent;
import com.fenghongzhang.day003mvp.DaggerMainActivityComp;
import com.fenghongzhang.day003mvp.FoodMoudel;
import com.fenghongzhang.day003mvp.R;
import com.fenghongzhang.day003mvp.StudentMoudle;
import com.fenghongzhang.day003mvp.contract.FoodContract;
import com.fenghongzhang.day003mvp.entity.Food;
import com.fenghongzhang.day003mvp.entity.Student;
import com.fenghongzhang.day003mvp.model.FoodModel;
import com.fenghongzhang.day003mvp.presenter.FoodPresenter;
import com.fenghongzhang.mvp_lib.view.BaseActivity;

import java.util.List;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity<FoodPresenter> implements FoodContract.IFoodView {

    private static final String TAG = "MainActivity";



    //成员变量的位置
//    @Inject
    Student student;

    @BindView(R.id.btn)
    Button btn;
    @BindView(R.id.btn1)
    Button btn1;

    @Override
    public int bindLayout() {
        return R.layout.activity_main;
    }

    @Override
    public void initView() {
        ButterKnife.bind(this);
    }

    @Override
    public void initDate() {
//        presenter = new FoodPresenter(new FoodModel(), this);

        DaggerMainActivityComp.builder().foodMoudel(new FoodMoudel(this)).build().inject(this);
        presenter.getDate();



//        student = new Student();
//        DaggerActivityComponent.builder().build().inject(this);

//        DaggerActivityComponent.builder().studentMoudle(new StudentMoudle("哈哈哈")).build().inject(this);
//        Toast.makeText(this, student.getName(), Toast.LENGTH_SHORT).show();

    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void initAdapter(List<Food.DataBean> list) {
        Log.i(TAG, "initAdapter: " + list.size());
    }


}
